home *** CD-ROM | disk | FTP | other *** search
- on stopMovie
- dialogClose()
- end
-
- on doControl delayTime
- global gAutoMode, gTeaserMode, gResellerVersion, gAutoDelay, gAutoTestMode, gTopicList, gCurrTopic, gDialogWindow, gLastTextBox, gSectionAnimationSpeed, gCDROMversion, gLastAudio, gAudioPath
- if objectp(gDialogWindow) then
- go(the frame)
- exit
- end if
- if gCDROMversion = 1 then
- if the type of sprite 22 = 7 then
- set audioFname to the name of cast the castNum of sprite 22
- if audioFname <> gLastAudio then
- preLoad(marker(1))
- set gLastAudio to audioFname
- waitMouse(30)
- delete char 7 to 10 of audioFname
- puppetSound(cast audioFname)
- updateStage()
- end if
- end if
- end if
- if gAutoMode = 1 then
- if voidp(delayTime) then
- if the type of sprite 22 = 7 then
- set frameText to the text of cast the castNum of sprite 22
- set delayTime to the number of chars in frameText * gAutoDelay
- if gLastTextBox = frameText then
- set differentText to 0
- set delayTime to delayTime / 7
- else
- set differentText to 1
- set gLastTextBox to frameText
- end if
- else
- set delayTime to gSectionAnimationSpeed
- end if
- else
- set delayTime to delayTime * 60
- end if
- if differentText = 0 then
- if gAutoTestMode = 0 then
- if waitMouse(delayTime) then
- exit
- end if
- else
- if waitMouse() then
- exit
- end if
- end if
- else
- if waitMouse(delayTime / 2) then
- exit
- end if
- end if
- if (((the frame + 1) = marker(1)) or (the frameLabel = "end")) and soundBusy(1) then
- if waitAudioMouse(1) then
- exit
- end if
- if waitMouse(160) then
- exit
- end if
- end if
- if the frameLabel <> "end" then
- go(the frame + 1)
- else
- set gCurrTopic to gCurrTopic + 1
- if (gCurrTopic < 1) or (gCurrTopic > the number of lines in gTopicList) then
- set gAutoMode to 0
- if gResellerVersion = 1 then
- if gTeaserMode = 0 then
- endAutoDemoDialogReseller()
- exit
- else
- goCloser()
- end if
- else
- endAutoDemoDialog()
- exit
- end if
- else
- set topic to line gCurrTopic of gTopicList
- go(1, topic)
- end if
- end if
- else
- if the frame = marker(0) then
- if the type of sprite 37 = 0 then
- blinkForwardArrow()
- else
- showNextBtn()
- end if
- else
- showNextBtn()
- end if
- end if
- end
-
- on waitMouse t
- if voidp(t) then
- set t to 10
- end if
- startTimer()
- repeat while the timer < t
- if the mouseDown then
- return 1
- end if
- end repeat
- return 0
- end
-
- on waitAudioMouse ch
- repeat while soundBusy(ch)
- if the mouseDown then
- return 1
- end if
- end repeat
- return 0
- end
-
- on wait t
- if voidp(t) then
- set t to 10
- end if
- startTimer()
- repeat while the timer < t
- nothing()
- end repeat
- end
-
- on keyDown
- global gMainMovieName, gResellerVersion, gAutoMode, gNextKey, gBackKey, gMenuKey, gRestartKey, gExitKey
- set k to the key
- set kcode to the keyCode
- if (the movie <> gMainMovieName) and (gAutoMode = 0) then
- set channel to 0
- if k = gNextKey then
- set channel to 24
- else
- if k = gBackKey then
- set channel to 23
- else
- if k = gMenuKey then
- set channel to 25
- else
- if (k = gRestartKey) and (gResellerVersion = 1) then
- set channel to 28
- else
- if (k = gExitKey) and (gResellerVersion = 0) then
- set channel to 27
- else
- if kcode = 53 then
- exitDialog()
- dontPassEvent()
- else
- if (k = TAB) or (k = RETURN) or (k = ENTER) then
- doControlPanelKeys()
- exit
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- if channel <> 0 then
- hiliteButton(channel)
- set gDontHilite to 0
- mouseDown(script the scriptNum of sprite channel)
- end if
- end if
- end
-
- on doControlPanelKeys
- global gCurrCPButton, gCPbuttonIndex, gDontHilite, gAutoMode
- if voidp(gCurrCPButton) or (gCurrCPButton = 0) then
- set gCurrCPButton to 1
- end if
- set lastspritePos to gCurrCPButton
- set startSprite to 1
- set endSprite to 4
- if gAutoMode = 1 then
- exit
- end if
- if the key = TAB then
- if not (the shiftDown) then
- if lastspritePos < endSprite then
- set gCurrCPButton to gCurrCPButton + 1
- else
- set gCurrCPButton to startSprite
- end if
- else
- if lastspritePos = startSprite then
- set gCurrCPButton to endSprite
- else
- set gCurrCPButton to gCurrCPButton - 1
- end if
- end if
- set lastsprite to value(line lastspritePos of gCPbuttonIndex)
- set c to the castNum of sprite lastsprite
- set the castNum of sprite lastsprite to c - 1
- set newSprite to value(line gCurrCPButton of gCPbuttonIndex)
- set c to the castNum of sprite newSprite
- set the castNum of sprite newSprite to c + 1
- updateStage()
- else
- if (the key = RETURN) or (the key = ENTER) then
- set lastsprite to value(line lastspritePos of gCPbuttonIndex)
- hiliteButton(lastsprite)
- resetNextButton()
- set gDontHilite to 1
- mouseDown(script the scriptNum of sprite lastsprite)
- end if
- end if
- end
-
- on resetNextButton
- global gCurrCPButton, gCPbuttonIndex
- set lastspritePos to gCurrCPButton
- set gCurrCPButton to 1
- set lastsprite to value(line lastspritePos of gCPbuttonIndex)
- set c to the castNum of sprite lastsprite
- set the castNum of sprite lastsprite to c - 1
- set newSprite to value(line gCurrCPButton of gCPbuttonIndex)
- set c to the castNum of sprite newSprite
- set the castNum of sprite newSprite to c + 1
- end
-
- on doMenuKeys theKey, startSprite, endSprite
- global gCurrDialogButton, gDontHilite, gResellerVersion
- if voidp(gCurrDialogButton) or (gCurrDialogButton = 0) then
- set gCurrDialogButton to 9
- end if
- set lastsprite to gCurrDialogButton
- if the key = TAB then
- if not (the shiftDown) then
- if lastsprite < endSprite then
- set gCurrDialogButton to gCurrDialogButton + 1
- else
- set gCurrDialogButton to startSprite
- end if
- else
- if lastsprite = startSprite then
- set gCurrDialogButton to endSprite
- else
- set gCurrDialogButton to gCurrDialogButton - 1
- end if
- end if
- set c to the castNum of sprite lastsprite
- set the castNum of sprite lastsprite to c - 1
- set c to the castNum of sprite gCurrDialogButton
- set the castNum of sprite gCurrDialogButton to c + 1
- updateStage()
- else
- if (the key = RETURN) or (the key = ENTER) then
- hiliteButton(lastsprite)
- set gDontHilite to 1
- mouseDown(script the scriptNum of sprite lastsprite)
- else
- if the keyCode = 53 then
- exitDialog()
- dontPassEvent()
- end if
- end if
- end if
- end
-